SlideShare a Scribd company logo
1 of 25
To get started, select MATLAB Help or Demos from the Help menu.

The element type "name" must be terminated by the matching end-tag "</name>".
Could not parse the file: c:matlab7toolboxccslinkccslinkinfo.xml
>> s=pi*5^2

s=

 78.5398

>> v=s*10

v=

 785.3982

>> qiuhe(9)

ans =

  1.0000

>> qiuhe(9)

ans =

  1.0000

>> qiuhe(9)

ans =

  2.8290

>> qiuhe(-9)

ans =

  -9

>> zs(3)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 5 Column: 10
Missing variable or function.

>> zs(3)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
This statement is incomplete.
>> zs(3)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 5
This statement is incomplete.

>> zs(3)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
This statement is incomplete.

>> zs(3)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 7 Column: 8
This statement is incomplete.

>> zs(3)

ans =

   1

>> zs(19)

ans =

   1

>> zs(1:19)
>> zs(1:19)
>> zs(3,19)
??? Error using ==> zs
Too many input arguments.

>> isprime(3)

ans =

   1

>> help prime

prime.m not found.

Use the Help browser Search tab to search the documentation, or
type "help help" for help command options, such as help for methods.

>> prime(3:19)
??? Undefined command/function 'prime'.

>> mod(1:9,3)
ans =

   1    2    0    1   2   0   1   2    0

>> zs(3:9)

ans =

   1

>> zs(4:9)

ans =

   1

>> zs(4:9)

ans =

   1

>> help mod
MOD Modulus after division.
  MOD(x,y) is x - n.*y where n = floor(x./y) if y ~= 0. If y is not an
  integer and the quotient x./y is within roundoff error of an integer,
  then n is that integer. By convention, MOD(x,0) is x. The input
  x and y must be real arrays of the same size, or real scalars.

  The statement "x and y are congruent mod m" means mod(x,m) == mod(y,m).

  MOD(x,y) has the same sign as y while REM(x,y) has the same sign as x.
  MOD(x,y) and REM(x,y) are equal if x and y have the same sign, but
  differ by y if x and y have different signs.

  See also rem.

  Overloaded functions or methods (ones with the same name in other directories)
   help sym/mod.m

  Reference page in Help browser
   doc mod



>> zs(8)

ans =
0

>> zs(8)

ans =

  0

>> zs(8)

ans =

  0

>> zs(8)

ans =

  0

>> zs(8)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
The expression to the left of the equals sign is not a valid target for an assignment.

>> zs(8)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
The expression to the left of the equals sign is not a valid target for an assignment.

>> zs(8)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
The expression to the left of the equals sign is not a valid target for an assignment.

>> zs(8)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
The expression to the left of the equals sign is not a valid target for an assignment.

>> showzs(8)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
The expression to the left of the equals sign is not a valid target for an assignment.

Error in ==> showzs at 5
  if zs(i)

>> showzs(8)
??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8
The expression to the left of the equals sign is not a valid target for an assignment.
Error in ==> showzs at 5
  if zs(i)

>> zs(8)

ans =

  0

>> zs(8)

ans =

  0

>> showzs(8)

ans =

  2     3    5    7

>> showzs(100)

ans =

 Columns 1 through 14

  2     3    5    7   11   13   17   19   23   29   31   37   41   43

 Columns 15 through 25

  47    53   59    61   67   71   73   79   83   89   97

>> y=[1;2;3]

y=

  1
  2
  3

>> y=[y;9]

y=

  1
  2
  3
  9
>> A=[1 2; 3 4]

A=

  1    2
  3    4

>> A=[A;[5 6]]

A=

  1    2
  3    4
  5    6

>> A=[A [7;8;9]]

A=

  1    2   7
  3    4   8
  5    6   9



>> A

A=

  1    2   7
  3    4   8
  5    6   9

>> A=[1 2; 3 4]

A=

  1    2
  3    4

>> A=[A [7;8];[5 6 9]]

A=

  1    2   7
  3    4   8
  5    6   9
>> %-- 09-2-19 上午 10:58 --%
>> A=[2 5;9 7]

A=

     2   5
     9   7

>> B=[9 6;3 1]

B=

     9   6
     3   1

>> A*B

ans =

  33 17
 102 61

>> I=[1 0;0 1]

I=

     1   0
     0   1

>> A*I

ans =

     2   5
     9   7

>> B*I

ans =

  9      6
   3      1

>> C=A^(-1)

C=

 -0.2258 0.1613
  0.2903 -0.0645
>> A*C

ans =

  1.0000       0
  0.0000    1.0000

>> % C 为 A 的逆矩阵
>> D=[2 3;4 6]

D=

   2    3
   4    6

>> D^(-1)
Warning: Matrix is singular to working precision.

ans =

 Inf Inf
 Inf Inf

>> B^(-1)

ans =

 -0.1111 0.6667
  0.3333 -1.0000

>> A = [2 3 -1; 1 -12 8; 6 5 -11];
>> b = [6;12;1];
>> x = A^(-1)*b

x=

  3.1690
  0.5106
  1.8697

>> A

A=

   2 3 -1
   1 -12 8
   6 5 -11
>> A(2,5)=0

A=

  2 3 -1         0    0
  1 -12 8         0    0
  6 5 -11         0    0

>> size(A)

ans =

  3     5

>> X=1:6

X=

  1     2    3   4    5    6

>> X(:)

ans =

  1
  2
  3
  4
  5
  6

>> help sort
SORT Sort in ascending or descending order.
  For vectors, SORT(X) sorts the elements of X in ascending order.
  For matrices, SORT(X) sorts each column of X in ascending order.
  For N-D arrays, SORT(X) sorts the along the first non-singleton
  dimension of X. When X is a cell array of strings, SORT(X) sorts
  the strings in ASCII dictionary order.

  Y = SORT(X,DIM,MODE)
  has two optional parameters.
  DIM selects a dimension along which to sort.
  MODE selects the direction of the sort
    'ascend' results in ascending order
    'descend' results in descending order
  The result is in Y which has the same shape and type as X.

  [Y,I] = SORT(X,DIM,MODE) also returns an index matrix I.
  If X is a vector, then Y = X(I).
If X is an m-by-n matrix and DIM=1, then
     for j = 1:n, Y(:,j) = X(I(:,j),j); end

  When X is complex, the elements are sorted by ABS(X). Complex
  matches are further sorted by ANGLE(X).

  When more than one element has the same value, the order of the
  elements are preserved in the sorted result and the indexes of
  equal elements will be ascending in any index matrix.

  Example: If X = [3 7 5
            0 4 2]

  then sort(X,1) is [0 4 2 and sort(X,2) is [3 5 7
              3 7 5]            0 2 4];

  See also issorted, sortrows, min, max, mean, median.

  Overloaded functions or methods (ones with the same name in other directories)
   help cell/sort.m
   help sym/sort.m
   help xregdesign/sort.m
   help sweepset/sort.m

  Reference page in Help browser
   doc sort

 To get started, select MATLAB Help or Demos from the Help menu.

The element type "name" must be terminated by the matching end-tag "</name>".
Could not parse the file: c:matlab7toolboxccslinkccslinkinfo.xml
>> A=[2 5 1;3.5 9 8;-2 3 6]

A=

  2.0000 5.0000 1.0000
  3.5000 9.0000 8.0000
 -2.0000 3.0000 6.0000

>> format short
>> A

A=

  2.0000 5.0000 1.0000
  3.5000 9.0000 8.0000
 -2.0000 3.0000 6.0000

>> x=9;
>> y=pi/6;
>> A=[2,5,cos(y);sin(y),x^2,8;x/2 3 6]

A=

  2.0000 5.0000 0.8660
  0.5000 81.0000 8.0000
  4.5000 3.0000 6.0000

>> A(3 3)=0
??? A(3 3)=0
     |
Error: Missing MATLAB operator.

>> A(3,3)=0

A=

  2.0000 5.0000 0.8660
  0.5000 81.0000 8.0000
  4.5000 3.0000     0

>> help sort
SORT Sort in ascending or descending order.
  For vectors, SORT(X) sorts the elements of X in ascending order.
  For matrices, SORT(X) sorts each column of X in ascending order.
  For N-D arrays, SORT(X) sorts the along the first non-singleton
  dimension of X. When X is a cell array of strings, SORT(X) sorts
  the strings in ASCII dictionary order.

  Y = SORT(X,DIM,MODE)
  has two optional parameters.
  DIM selects a dimension along which to sort.
  MODE selects the direction of the sort
    'ascend' results in ascending order
    'descend' results in descending order
  The result is in Y which has the same shape and type as X.

  [Y,I] = SORT(X,DIM,MODE) also returns an index matrix I.
  If X is a vector, then Y = X(I).
  If X is an m-by-n matrix and DIM=1, then
     for j = 1:n, Y(:,j) = X(I(:,j),j); end

  When X is complex, the elements are sorted by ABS(X). Complex
  matches are further sorted by ANGLE(X).

  When more than one element has the same value, the order of the
  elements are preserved in the sorted result and the indexes of
  equal elements will be ascending in any index matrix.
Example: If X = [3 7 5
            0 4 2]

  then sort(X,1) is [0 4 2 and sort(X,2) is [3 5 7
              3 7 5]            0 2 4];

  See also issorted, sortrows, min, max, mean, median.

  Overloaded functions or methods (ones with the same name in other directories)
   help cell/sort.m
   help sym/sort.m
   help xregdesign/sort.m
   help sweepset/sort.m

  Reference page in Help browser
   doc sort



>> A(2,5)=1

A=

  2.0000 5.0000 0.8660              0       0
  0.5000 81.0000 8.0000              0   1.0000
  4.5000 3.0000     0           0        0

>> A(1)

ans =

   2

>> A(0)
??? Subscript indices must either be real positive integers or logicals.

>> size(A)

ans =

   3    5

>> length(A)

ans =

   5
>> x=1:6

x=

     1    2   3    4   5   6

>> y=reshape(x,2,3)

y=

     1    3   5
     2    4   6

>> y(:)

ans =

     1
     2
     3
     4
     5
     6

>> R=[1 5 8;3 9 -6]

R=

     1    5    8
     3    9   -6

>> S=[3.2 5 6;-1 0 3];
>> F=R+S*i

F=

 1.0000 + 3.2000i 5.0000 + 5.0000i 8.0000 + 6.0000i
 3.0000 - 1.0000i 9.0000       -6.0000 + 3.0000i

>> t=0:3:10

t=

     0    3   6    9

>> s=0:5:-18

s=
Empty matrix: 1-by-0

>> s=0:-5:-18

s=

     0   -5 -10 -15

>> t=0:5

t=

     0   1   2   3    4   5

>>>> A=[1 4 7 10;2 5 8 11;3 6 9 12]

A=

     1   4   7   10
     2   5   8   11
     3   6   9   12

>> B=[13 23 5 4 12;16 -24 -21 -18 10;14 0 28 -43 33;25 -3 -16 -1 11;13 -32 10 -20 -12]

B=

  13 23 5          4 12
  16 -24 -21      -18 10
  14 0 28        -43 33
  25 -3 -16       -1 11
  13 -32 10       -20 -12

>> A(8,3)=5

A=

     1   4   7   10
     2   5   8   11
     3   6   9   12
     0   0   0    0
     0   0   0    0
     0   0   0    0
     0   0   0    0
     0   0   5    0

>> B=[13 23 5 4 12;16 -24 -21 -18 10;14 0 28 -43 33;25 -3 -16 -1 11;13 -32 10 -20 -12]

B=
13 23 5         4 12
  16 -24 -21     -18 10
  14 0 28       -43 33
  25 -3 -16      -1 11
  13 -32 10      -20 -12

>> A=[1 4 7 10;2 5 8 11;3 6 9 12]

A=

   1   4   7   10
   2   5   8   11
   3   6   9   12

>> A(3,8)=5

A=

   1   4   7   10     0   0   0     0
   2   5   8   11     0   0   0     0
   3   6   9   12     0   0   0     5

>> x=1:8

x=

   1   2   3    4   5     6   7   8

>> A=(x,2,4)
??? A=(x,2,4)
     |
Error: Incomplete or misformed expression or statement.

>> A=reshape(x,2,4)

A=

   1   3   5    7
   2   4   6    8

>> x=1:8

x=

   1   2   3    4   5     6   7   8

>> A=(1 2 3 4;5 6 7 8)
??? A=(1 2 3 4;5 6 7 8)
     |
Error: Missing MATLAB operator.

>> A=[1 2 3 4;5 6 7 8]

A=

   1    2    3   4
   5    6    7   8

>> size(A)

ans =

   2    4

>> A(6)

ans =

   7

>> A=[1 2 3 4;5 6 7 8]

A=

   1    2    3   4
   5    6    7   8

>> A(6)

ans =

   7

>> x=[1,2,3]

x=

   1    2    3

>> y=[1;2;3]

y=

   1
   2
   3

>> size(x)
ans =

   1    3

>> size(y)

ans =

   3    1

>> length(x)

ans =

   3

>> length(y)

ans =

   3

>> x=1:30

x=

 Columns 1 through 11

   1    2    3     4     5     6     7    8   9    10   11

 Columns 12 through 22

  12    13    14    15       16    17    18   19   20   21   22

 Columns 23 through 30

  23    24    25    26       27    28    29   30

>> x=1:30;
>> A=reshape(x,5,6)

A=

   1     6   11    16    21       26
   2     7   12    17    22       27
   3     8   13    18    23       28
   4     9   14    19    24       29
   5    10    15    20    25       30
>> R=[1 2 3 4 5 6]

R=

  1     2   3   4    5   6

>> S=[1 2 3 4 5 6];
>> A=R+s*i
??? Error using ==> plus
Matrix dimensions must agree.

>> S

S=

  1     2   3   4    5   6

>> A=R+S*i

A=

 Columns 1 through 4

 1.0000 + 1.0000i 2.0000 + 2.0000i 3.0000 + 3.0000i 4.0000 + 4.0000i

 Columns 5 through 6

 5.0000 + 5.0000i 6.0000 + 6.0000i

>> A'

ans =

 1.0000 - 1.0000i
 2.0000 - 2.0000i
 3.0000 - 3.0000i
 4.0000 - 4.0000i
 5.0000 - 5.0000i
 6.0000 - 6.0000i

>> A'*A

ans =

  2      4 6 8 10 12
  4      8 12 16 20 24
  6     12 18 24 30 36
  8     16 24 32 40 48
10    20    30    40       50    60
  12    24    36    48       60    72

>> x=1:2:20

x=

  1     3    5     7     9    11    13     15    17   19

>> length(x)

ans =

  10

>> x=0.2:0.3:3.5

x=

 Columns 1 through 7

  0.2000     0.5000      0.8000         1.1000   1.4000    1.7000   2.0000

 Columns 8 through 12

  2.3000     2.6000      2.9000         3.2000   3.5000

>> y=sin(x)

y=

 Columns 1 through 7

  0.1987     0.4794      0.7174         0.8912   0.9854    0.9917   0.9093

 Columns 8 through 12

  0.7457     0.5155      0.2392 -0.0584 -0.3508

>> max(y)

ans =

  0.9917

>> length(y)

ans =
12

>> sum(y)/length(y)

ans =

  0.5220

>> help mean
MEAN Average or mean value.
  For vectors, MEAN(X) is the mean value of the elements in X. For
  matrices, MEAN(X) is a row vector containing the mean value of
  each column. For N-D arrays, MEAN(X) is the mean value of the
  elements along the first non-singleton dimension of X.

  MEAN(X,DIM) takes the mean along the dimension DIM of X.

  Example: If X = [0 1 2
            3 4 5]

  then mean(X,1) is [1.5 2.5 3.5] and mean(X,2) is [1
                                  4]

  Class support for input X:
   float: double, single

  See also median, std, min, max, cov.

  Overloaded functions or methods (ones with the same name in other directories)
   help fints/mean.m
   help sweepset/mean.m

  Reference page in Help browser
   doc mean



>> mean(y)

ans =

  0.5220

>> help max
MAX Largest component.
  For vectors, MAX(X) is the largest element in X. For matrices,
  MAX(X) is a row vector containing the maximum element from each
  column. For N-D arrays, MAX(X) operates along the first
  non-singleton dimension.
[Y,I] = MAX(X) returns the indices of the maximum values in vector I.
  If the values along the first non-singleton dimension contain more
  than one maximal element, the index of the first one is returned.

  MAX(X,Y) returns an array the same size as X and Y with the
  largest elements taken from X or Y. Either one can be a scalar.

  [Y,I] = MAX(X,[],DIM) operates along the dimension DIM.

  When complex, the magnitude MAX(ABS(X)) is used, and the angle
  ANGLE(X) is ignored. NaN's are ignored when computing the maximum.

  Example: If X = [2 8 4 then max(X,[],1) is [7 8 9],
            7 3 9]

     max(X,[],2) is [8   and max(X,5) is [5 8 5
              9],            7 5 9].

  See also min, median, mean, sort.

  Overloaded functions or methods (ones with the same name in other directories)
   help quantizer/max.m
   help fints/max.m
   help localpspline/max.m
   help localpoly/max.m

  Reference page in Help browser
   doc max



>> [Y,y] = MAX(X)
??? Undefined function or variable 'X'.

>> man(Y,y)
??? Undefined function or variable 'Y'.

>> man(y)
??? Undefined command/function 'man'.

>> max(y)

ans =

  0.9917

>> find(y==max(y))
ans =

   6

>> x=rand(5,1)

x=

  0.9501
  0.2311
  0.6068
  0.4860
  0.8913

>> sort(x)

ans =

  0.2311
  0.4860
  0.6068
  0.8913
  0.9501

>> help sort
SORT Sort in ascending or descending order.
  For vectors, SORT(X) sorts the elements of X in ascending order.
  For matrices, SORT(X) sorts each column of X in ascending order.
  For N-D arrays, SORT(X) sorts the along the first non-singleton
  dimension of X. When X is a cell array of strings, SORT(X) sorts
  the strings in ASCII dictionary order.

  Y = SORT(X,DIM,MODE)
  has two optional parameters.
  DIM selects a dimension along which to sort.
  MODE selects the direction of the sort
    'ascend' results in ascending order
    'descend' results in descending order
  The result is in Y which has the same shape and type as X.

  [Y,I] = SORT(X,DIM,MODE) also returns an index matrix I.
  If X is a vector, then Y = X(I).
  If X is an m-by-n matrix and DIM=1, then
     for j = 1:n, Y(:,j) = X(I(:,j),j); end

  When X is complex, the elements are sorted by ABS(X). Complex
  matches are further sorted by ANGLE(X).

  When more than one element has the same value, the order of the
elements are preserved in the sorted result and the indexes of
  equal elements will be ascending in any index matrix.

  Example: If X = [3 7 5
            0 4 2]

  then sort(X,1) is [0 4 2 and sort(X,2) is [3 5 7
              3 7 5]            0 2 4];

  See also issorted, sortrows, min, max, mean, median.

  Overloaded functions or methods (ones with the same name in other directories)
   help cell/sort.m
   help sym/sort.m
   help xregdesign/sort.m
   help sweepset/sort.m

  Reference page in Help browser
   doc sort



>> sort(x,ascend)
??? Undefined function or variable 'ascend'.

>> sort(x,ascending)
??? Undefined function or variable 'ascending'.

>> sort(x,'ascending')
??? Error using ==> sort
sorting direction must be 'ascend' or 'descend'.

>> sort(x,descend)
??? Undefined function or variable 'descend'.

>> -sort(-x)

ans =

  0.9501
  0.8913
  0.6068
  0.4860
  0.2311

>> -x

ans =
-0.9501
 -0.2311
 -0.6068
 -0.4860
 -0.8913

>> a=-x

a=

 -0.9501
 -0.2311
 -0.6068
 -0.4860
 -0.8913

>> sort(a)

ans =

 -0.9501
 -0.8913
 -0.6068
 -0.4860
 -0.2311

>> -sort(-x)

ans =

  0.9501
  0.8913
  0.6068
  0.4860
  0.2311

>> sort(-x)

ans =

 -0.9501
 -0.8913
 -0.6068
 -0.4860
 -0.2311

>> -sort(-a)

ans =
-0.2311
 -0.4860
 -0.6068
 -0.8913
 -0.9501

>>

More Related Content

What's hot

Module 1 quadratic functions
Module 1   quadratic functionsModule 1   quadratic functions
Module 1 quadratic functionsdionesioable
 
List and Dictionary in python
List and Dictionary in pythonList and Dictionary in python
List and Dictionary in pythonSangita Panchal
 
Module 1 linear functions
Module 1   linear functionsModule 1   linear functions
Module 1 linear functionsdionesioable
 
Module 3 quadratic functions
Module 3   quadratic functionsModule 3   quadratic functions
Module 3 quadratic functionsdionesioable
 
11 graphs of first degree functions x
11 graphs of first degree functions x11 graphs of first degree functions x
11 graphs of first degree functions xmath260
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltasjesquerrev1
 
Factorising Quadratics
Factorising QuadraticsFactorising Quadratics
Factorising QuadraticsMr C
 
Matlab ch1 (3)
Matlab ch1 (3)Matlab ch1 (3)
Matlab ch1 (3)mohsinggg
 
8 inequalities and sign charts x
8 inequalities and sign charts x8 inequalities and sign charts x
8 inequalities and sign charts xmath260
 
1.6 sign charts and inequalities t
1.6 sign charts and inequalities t1.6 sign charts and inequalities t
1.6 sign charts and inequalities tmath260
 
7 sign charts of factorable formulas y
7 sign charts of factorable formulas y7 sign charts of factorable formulas y
7 sign charts of factorable formulas ymath260
 
February 11 2016
February 11 2016February 11 2016
February 11 2016khyps13
 
Introduction to Functions
Introduction to FunctionsIntroduction to Functions
Introduction to FunctionsMelanie Loslo
 
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMSAS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMSRACSOelimu
 
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...RhiannonBanksss
 
1.2 algebraic expressions
1.2 algebraic expressions1.2 algebraic expressions
1.2 algebraic expressionsmath260
 

What's hot (20)

Graph a function
Graph a functionGraph a function
Graph a function
 
Module 1 quadratic functions
Module 1   quadratic functionsModule 1   quadratic functions
Module 1 quadratic functions
 
Python
PythonPython
Python
 
Funcion lineal y cuadratica
Funcion lineal y cuadraticaFuncion lineal y cuadratica
Funcion lineal y cuadratica
 
List and Dictionary in python
List and Dictionary in pythonList and Dictionary in python
List and Dictionary in python
 
Module 1 linear functions
Module 1   linear functionsModule 1   linear functions
Module 1 linear functions
 
Module 3 quadratic functions
Module 3   quadratic functionsModule 3   quadratic functions
Module 3 quadratic functions
 
11 graphs of first degree functions x
11 graphs of first degree functions x11 graphs of first degree functions x
11 graphs of first degree functions x
 
S1 3 derivadas_resueltas
S1 3 derivadas_resueltasS1 3 derivadas_resueltas
S1 3 derivadas_resueltas
 
Factorising Quadratics
Factorising QuadraticsFactorising Quadratics
Factorising Quadratics
 
Matlab ch1 (3)
Matlab ch1 (3)Matlab ch1 (3)
Matlab ch1 (3)
 
Minimization model by simplex method
Minimization model by simplex methodMinimization model by simplex method
Minimization model by simplex method
 
8 inequalities and sign charts x
8 inequalities and sign charts x8 inequalities and sign charts x
8 inequalities and sign charts x
 
1.6 sign charts and inequalities t
1.6 sign charts and inequalities t1.6 sign charts and inequalities t
1.6 sign charts and inequalities t
 
7 sign charts of factorable formulas y
7 sign charts of factorable formulas y7 sign charts of factorable formulas y
7 sign charts of factorable formulas y
 
February 11 2016
February 11 2016February 11 2016
February 11 2016
 
Introduction to Functions
Introduction to FunctionsIntroduction to Functions
Introduction to Functions
 
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMSAS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
AS LEVEL QUADRATIC (CIE) EXPLAINED WITH EXAMPLE AND DIAGRAMS
 
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
Solutions Manual for College Algebra Concepts Through Functions 3rd Edition b...
 
1.2 algebraic expressions
1.2 algebraic expressions1.2 algebraic expressions
1.2 algebraic expressions
 

Similar to 20100528

Similar to 20100528 (20)

Matlab Tutorial
Matlab TutorialMatlab Tutorial
Matlab Tutorial
 
R for Statistical Computing
R for Statistical ComputingR for Statistical Computing
R for Statistical Computing
 
Basic concepts in_matlab
Basic concepts in_matlabBasic concepts in_matlab
Basic concepts in_matlab
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
Basic R Data Manipulation
Basic R Data ManipulationBasic R Data Manipulation
Basic R Data Manipulation
 
presentation.pptx
presentation.pptxpresentation.pptx
presentation.pptx
 
Matlabch01
Matlabch01Matlabch01
Matlabch01
 
Matlab-free course by Mohd Esa
Matlab-free course by Mohd EsaMatlab-free course by Mohd Esa
Matlab-free course by Mohd Esa
 
Introduction to matlab lecture 3 of 4
Introduction to matlab lecture 3 of 4Introduction to matlab lecture 3 of 4
Introduction to matlab lecture 3 of 4
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
 
Matlab1
Matlab1Matlab1
Matlab1
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
 
Programming in R
Programming in RProgramming in R
Programming in R
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4
 
R Programming Intro
R Programming IntroR Programming Intro
R Programming Intro
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Python.pdf
Python.pdfPython.pdf
Python.pdf
 
Lr4 math cad
Lr4 math cadLr4 math cad
Lr4 math cad
 
Mat lab
Mat labMat lab
Mat lab
 

More from byron zhao

从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】byron zhao
 
从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】byron zhao
 
网页设计语言教程Html css
网页设计语言教程Html css网页设计语言教程Html css
网页设计语言教程Html cssbyron zhao
 
Digital booklet sparks fly deluxe
Digital booklet   sparks fly deluxeDigital booklet   sparks fly deluxe
Digital booklet sparks fly deluxebyron zhao
 
《电子技术基础(模拟部分)》康华光第五版...(1)
《电子技术基础(模拟部分)》康华光第五版...(1)《电子技术基础(模拟部分)》康华光第五版...(1)
《电子技术基础(模拟部分)》康华光第五版...(1)byron zhao
 
回转器的原理与应用
回转器的原理与应用回转器的原理与应用
回转器的原理与应用byron zhao
 
新概念第四册课文打印版
新概念第四册课文打印版新概念第四册课文打印版
新概念第四册课文打印版byron zhao
 
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作byron zhao
 
未命名 1.odt
未命名 1.odt未命名 1.odt
未命名 1.odtbyron zhao
 
小波变换程序
小波变换程序小波变换程序
小波变换程序byron zhao
 
小波变换程序.odt
小波变换程序.odt小波变换程序.odt
小波变换程序.odtbyron zhao
 
健康上网专家密码
健康上网专家密码健康上网专家密码
健康上网专家密码byron zhao
 
大物实验报告(太阳能电池).odt
大物实验报告(太阳能电池).odt大物实验报告(太阳能电池).odt
大物实验报告(太阳能电池).odtbyron zhao
 
2009级 截止至2011年1月成绩汇总表
2009级 截止至2011年1月成绩汇总表2009级 截止至2011年1月成绩汇总表
2009级 截止至2011年1月成绩汇总表byron zhao
 

More from byron zhao (20)

从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】
 
从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】从研究生角度,回望大学四年数学建模路【原创】
从研究生角度,回望大学四年数学建模路【原创】
 
网页设计语言教程Html css
网页设计语言教程Html css网页设计语言教程Html css
网页设计语言教程Html css
 
Digital booklet sparks fly deluxe
Digital booklet   sparks fly deluxeDigital booklet   sparks fly deluxe
Digital booklet sparks fly deluxe
 
《电子技术基础(模拟部分)》康华光第五版...(1)
《电子技术基础(模拟部分)》康华光第五版...(1)《电子技术基础(模拟部分)》康华光第五版...(1)
《电子技术基础(模拟部分)》康华光第五版...(1)
 
电路作业
电路作业电路作业
电路作业
 
Multisim8
Multisim8Multisim8
Multisim8
 
回转器的原理与应用
回转器的原理与应用回转器的原理与应用
回转器的原理与应用
 
新概念第四册课文打印版
新概念第四册课文打印版新概念第四册课文打印版
新概念第四册课文打印版
 
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
 
未命名 1.odt
未命名 1.odt未命名 1.odt
未命名 1.odt
 
027501-01
027501-01027501-01
027501-01
 
小波变换程序
小波变换程序小波变换程序
小波变换程序
 
未命名 24
未命名 24未命名 24
未命名 24
 
小波变换程序.odt
小波变换程序.odt小波变换程序.odt
小波变换程序.odt
 
刚体
刚体刚体
刚体
 
健康上网专家密码
健康上网专家密码健康上网专家密码
健康上网专家密码
 
大物实验报告(太阳能电池).odt
大物实验报告(太阳能电池).odt大物实验报告(太阳能电池).odt
大物实验报告(太阳能电池).odt
 
2009级 截止至2011年1月成绩汇总表
2009级 截止至2011年1月成绩汇总表2009级 截止至2011年1月成绩汇总表
2009级 截止至2011年1月成绩汇总表
 
电路作业
电路作业电路作业
电路作业
 

20100528

  • 1. To get started, select MATLAB Help or Demos from the Help menu. The element type "name" must be terminated by the matching end-tag "</name>". Could not parse the file: c:matlab7toolboxccslinkccslinkinfo.xml >> s=pi*5^2 s= 78.5398 >> v=s*10 v= 785.3982 >> qiuhe(9) ans = 1.0000 >> qiuhe(9) ans = 1.0000 >> qiuhe(9) ans = 2.8290 >> qiuhe(-9) ans = -9 >> zs(3) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 5 Column: 10 Missing variable or function. >> zs(3) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 This statement is incomplete.
  • 2. >> zs(3) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 5 This statement is incomplete. >> zs(3) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 This statement is incomplete. >> zs(3) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 7 Column: 8 This statement is incomplete. >> zs(3) ans = 1 >> zs(19) ans = 1 >> zs(1:19) >> zs(1:19) >> zs(3,19) ??? Error using ==> zs Too many input arguments. >> isprime(3) ans = 1 >> help prime prime.m not found. Use the Help browser Search tab to search the documentation, or type "help help" for help command options, such as help for methods. >> prime(3:19) ??? Undefined command/function 'prime'. >> mod(1:9,3)
  • 3. ans = 1 2 0 1 2 0 1 2 0 >> zs(3:9) ans = 1 >> zs(4:9) ans = 1 >> zs(4:9) ans = 1 >> help mod MOD Modulus after division. MOD(x,y) is x - n.*y where n = floor(x./y) if y ~= 0. If y is not an integer and the quotient x./y is within roundoff error of an integer, then n is that integer. By convention, MOD(x,0) is x. The input x and y must be real arrays of the same size, or real scalars. The statement "x and y are congruent mod m" means mod(x,m) == mod(y,m). MOD(x,y) has the same sign as y while REM(x,y) has the same sign as x. MOD(x,y) and REM(x,y) are equal if x and y have the same sign, but differ by y if x and y have different signs. See also rem. Overloaded functions or methods (ones with the same name in other directories) help sym/mod.m Reference page in Help browser doc mod >> zs(8) ans =
  • 4. 0 >> zs(8) ans = 0 >> zs(8) ans = 0 >> zs(8) ans = 0 >> zs(8) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 The expression to the left of the equals sign is not a valid target for an assignment. >> zs(8) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 The expression to the left of the equals sign is not a valid target for an assignment. >> zs(8) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 The expression to the left of the equals sign is not a valid target for an assignment. >> zs(8) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 The expression to the left of the equals sign is not a valid target for an assignment. >> showzs(8) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 The expression to the left of the equals sign is not a valid target for an assignment. Error in ==> showzs at 5 if zs(i) >> showzs(8) ??? Error: File: C:¥Documents and Settings¥Administrator¥桌面¥test¥zs.m Line: 8 Column: 8 The expression to the left of the equals sign is not a valid target for an assignment.
  • 5. Error in ==> showzs at 5 if zs(i) >> zs(8) ans = 0 >> zs(8) ans = 0 >> showzs(8) ans = 2 3 5 7 >> showzs(100) ans = Columns 1 through 14 2 3 5 7 11 13 17 19 23 29 31 37 41 43 Columns 15 through 25 47 53 59 61 67 71 73 79 83 89 97 >> y=[1;2;3] y= 1 2 3 >> y=[y;9] y= 1 2 3 9
  • 6. >> A=[1 2; 3 4] A= 1 2 3 4 >> A=[A;[5 6]] A= 1 2 3 4 5 6 >> A=[A [7;8;9]] A= 1 2 7 3 4 8 5 6 9 >> A A= 1 2 7 3 4 8 5 6 9 >> A=[1 2; 3 4] A= 1 2 3 4 >> A=[A [7;8];[5 6 9]] A= 1 2 7 3 4 8 5 6 9
  • 7. >> %-- 09-2-19 上午 10:58 --% >> A=[2 5;9 7] A= 2 5 9 7 >> B=[9 6;3 1] B= 9 6 3 1 >> A*B ans = 33 17 102 61 >> I=[1 0;0 1] I= 1 0 0 1 >> A*I ans = 2 5 9 7 >> B*I ans = 9 6 3 1 >> C=A^(-1) C= -0.2258 0.1613 0.2903 -0.0645
  • 8. >> A*C ans = 1.0000 0 0.0000 1.0000 >> % C 为 A 的逆矩阵 >> D=[2 3;4 6] D= 2 3 4 6 >> D^(-1) Warning: Matrix is singular to working precision. ans = Inf Inf Inf Inf >> B^(-1) ans = -0.1111 0.6667 0.3333 -1.0000 >> A = [2 3 -1; 1 -12 8; 6 5 -11]; >> b = [6;12;1]; >> x = A^(-1)*b x= 3.1690 0.5106 1.8697 >> A A= 2 3 -1 1 -12 8 6 5 -11
  • 9. >> A(2,5)=0 A= 2 3 -1 0 0 1 -12 8 0 0 6 5 -11 0 0 >> size(A) ans = 3 5 >> X=1:6 X= 1 2 3 4 5 6 >> X(:) ans = 1 2 3 4 5 6 >> help sort SORT Sort in ascending or descending order. For vectors, SORT(X) sorts the elements of X in ascending order. For matrices, SORT(X) sorts each column of X in ascending order. For N-D arrays, SORT(X) sorts the along the first non-singleton dimension of X. When X is a cell array of strings, SORT(X) sorts the strings in ASCII dictionary order. Y = SORT(X,DIM,MODE) has two optional parameters. DIM selects a dimension along which to sort. MODE selects the direction of the sort 'ascend' results in ascending order 'descend' results in descending order The result is in Y which has the same shape and type as X. [Y,I] = SORT(X,DIM,MODE) also returns an index matrix I. If X is a vector, then Y = X(I).
  • 10. If X is an m-by-n matrix and DIM=1, then for j = 1:n, Y(:,j) = X(I(:,j),j); end When X is complex, the elements are sorted by ABS(X). Complex matches are further sorted by ANGLE(X). When more than one element has the same value, the order of the elements are preserved in the sorted result and the indexes of equal elements will be ascending in any index matrix. Example: If X = [3 7 5 0 4 2] then sort(X,1) is [0 4 2 and sort(X,2) is [3 5 7 3 7 5] 0 2 4]; See also issorted, sortrows, min, max, mean, median. Overloaded functions or methods (ones with the same name in other directories) help cell/sort.m help sym/sort.m help xregdesign/sort.m help sweepset/sort.m Reference page in Help browser doc sort To get started, select MATLAB Help or Demos from the Help menu. The element type "name" must be terminated by the matching end-tag "</name>". Could not parse the file: c:matlab7toolboxccslinkccslinkinfo.xml >> A=[2 5 1;3.5 9 8;-2 3 6] A= 2.0000 5.0000 1.0000 3.5000 9.0000 8.0000 -2.0000 3.0000 6.0000 >> format short >> A A= 2.0000 5.0000 1.0000 3.5000 9.0000 8.0000 -2.0000 3.0000 6.0000 >> x=9;
  • 11. >> y=pi/6; >> A=[2,5,cos(y);sin(y),x^2,8;x/2 3 6] A= 2.0000 5.0000 0.8660 0.5000 81.0000 8.0000 4.5000 3.0000 6.0000 >> A(3 3)=0 ??? A(3 3)=0 | Error: Missing MATLAB operator. >> A(3,3)=0 A= 2.0000 5.0000 0.8660 0.5000 81.0000 8.0000 4.5000 3.0000 0 >> help sort SORT Sort in ascending or descending order. For vectors, SORT(X) sorts the elements of X in ascending order. For matrices, SORT(X) sorts each column of X in ascending order. For N-D arrays, SORT(X) sorts the along the first non-singleton dimension of X. When X is a cell array of strings, SORT(X) sorts the strings in ASCII dictionary order. Y = SORT(X,DIM,MODE) has two optional parameters. DIM selects a dimension along which to sort. MODE selects the direction of the sort 'ascend' results in ascending order 'descend' results in descending order The result is in Y which has the same shape and type as X. [Y,I] = SORT(X,DIM,MODE) also returns an index matrix I. If X is a vector, then Y = X(I). If X is an m-by-n matrix and DIM=1, then for j = 1:n, Y(:,j) = X(I(:,j),j); end When X is complex, the elements are sorted by ABS(X). Complex matches are further sorted by ANGLE(X). When more than one element has the same value, the order of the elements are preserved in the sorted result and the indexes of equal elements will be ascending in any index matrix.
  • 12. Example: If X = [3 7 5 0 4 2] then sort(X,1) is [0 4 2 and sort(X,2) is [3 5 7 3 7 5] 0 2 4]; See also issorted, sortrows, min, max, mean, median. Overloaded functions or methods (ones with the same name in other directories) help cell/sort.m help sym/sort.m help xregdesign/sort.m help sweepset/sort.m Reference page in Help browser doc sort >> A(2,5)=1 A= 2.0000 5.0000 0.8660 0 0 0.5000 81.0000 8.0000 0 1.0000 4.5000 3.0000 0 0 0 >> A(1) ans = 2 >> A(0) ??? Subscript indices must either be real positive integers or logicals. >> size(A) ans = 3 5 >> length(A) ans = 5
  • 13. >> x=1:6 x= 1 2 3 4 5 6 >> y=reshape(x,2,3) y= 1 3 5 2 4 6 >> y(:) ans = 1 2 3 4 5 6 >> R=[1 5 8;3 9 -6] R= 1 5 8 3 9 -6 >> S=[3.2 5 6;-1 0 3]; >> F=R+S*i F= 1.0000 + 3.2000i 5.0000 + 5.0000i 8.0000 + 6.0000i 3.0000 - 1.0000i 9.0000 -6.0000 + 3.0000i >> t=0:3:10 t= 0 3 6 9 >> s=0:5:-18 s=
  • 14. Empty matrix: 1-by-0 >> s=0:-5:-18 s= 0 -5 -10 -15 >> t=0:5 t= 0 1 2 3 4 5 >>>> A=[1 4 7 10;2 5 8 11;3 6 9 12] A= 1 4 7 10 2 5 8 11 3 6 9 12 >> B=[13 23 5 4 12;16 -24 -21 -18 10;14 0 28 -43 33;25 -3 -16 -1 11;13 -32 10 -20 -12] B= 13 23 5 4 12 16 -24 -21 -18 10 14 0 28 -43 33 25 -3 -16 -1 11 13 -32 10 -20 -12 >> A(8,3)=5 A= 1 4 7 10 2 5 8 11 3 6 9 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 >> B=[13 23 5 4 12;16 -24 -21 -18 10;14 0 28 -43 33;25 -3 -16 -1 11;13 -32 10 -20 -12] B=
  • 15. 13 23 5 4 12 16 -24 -21 -18 10 14 0 28 -43 33 25 -3 -16 -1 11 13 -32 10 -20 -12 >> A=[1 4 7 10;2 5 8 11;3 6 9 12] A= 1 4 7 10 2 5 8 11 3 6 9 12 >> A(3,8)=5 A= 1 4 7 10 0 0 0 0 2 5 8 11 0 0 0 0 3 6 9 12 0 0 0 5 >> x=1:8 x= 1 2 3 4 5 6 7 8 >> A=(x,2,4) ??? A=(x,2,4) | Error: Incomplete or misformed expression or statement. >> A=reshape(x,2,4) A= 1 3 5 7 2 4 6 8 >> x=1:8 x= 1 2 3 4 5 6 7 8 >> A=(1 2 3 4;5 6 7 8) ??? A=(1 2 3 4;5 6 7 8) |
  • 16. Error: Missing MATLAB operator. >> A=[1 2 3 4;5 6 7 8] A= 1 2 3 4 5 6 7 8 >> size(A) ans = 2 4 >> A(6) ans = 7 >> A=[1 2 3 4;5 6 7 8] A= 1 2 3 4 5 6 7 8 >> A(6) ans = 7 >> x=[1,2,3] x= 1 2 3 >> y=[1;2;3] y= 1 2 3 >> size(x)
  • 17. ans = 1 3 >> size(y) ans = 3 1 >> length(x) ans = 3 >> length(y) ans = 3 >> x=1:30 x= Columns 1 through 11 1 2 3 4 5 6 7 8 9 10 11 Columns 12 through 22 12 13 14 15 16 17 18 19 20 21 22 Columns 23 through 30 23 24 25 26 27 28 29 30 >> x=1:30; >> A=reshape(x,5,6) A= 1 6 11 16 21 26 2 7 12 17 22 27 3 8 13 18 23 28 4 9 14 19 24 29 5 10 15 20 25 30
  • 18. >> R=[1 2 3 4 5 6] R= 1 2 3 4 5 6 >> S=[1 2 3 4 5 6]; >> A=R+s*i ??? Error using ==> plus Matrix dimensions must agree. >> S S= 1 2 3 4 5 6 >> A=R+S*i A= Columns 1 through 4 1.0000 + 1.0000i 2.0000 + 2.0000i 3.0000 + 3.0000i 4.0000 + 4.0000i Columns 5 through 6 5.0000 + 5.0000i 6.0000 + 6.0000i >> A' ans = 1.0000 - 1.0000i 2.0000 - 2.0000i 3.0000 - 3.0000i 4.0000 - 4.0000i 5.0000 - 5.0000i 6.0000 - 6.0000i >> A'*A ans = 2 4 6 8 10 12 4 8 12 16 20 24 6 12 18 24 30 36 8 16 24 32 40 48
  • 19. 10 20 30 40 50 60 12 24 36 48 60 72 >> x=1:2:20 x= 1 3 5 7 9 11 13 15 17 19 >> length(x) ans = 10 >> x=0.2:0.3:3.5 x= Columns 1 through 7 0.2000 0.5000 0.8000 1.1000 1.4000 1.7000 2.0000 Columns 8 through 12 2.3000 2.6000 2.9000 3.2000 3.5000 >> y=sin(x) y= Columns 1 through 7 0.1987 0.4794 0.7174 0.8912 0.9854 0.9917 0.9093 Columns 8 through 12 0.7457 0.5155 0.2392 -0.0584 -0.3508 >> max(y) ans = 0.9917 >> length(y) ans =
  • 20. 12 >> sum(y)/length(y) ans = 0.5220 >> help mean MEAN Average or mean value. For vectors, MEAN(X) is the mean value of the elements in X. For matrices, MEAN(X) is a row vector containing the mean value of each column. For N-D arrays, MEAN(X) is the mean value of the elements along the first non-singleton dimension of X. MEAN(X,DIM) takes the mean along the dimension DIM of X. Example: If X = [0 1 2 3 4 5] then mean(X,1) is [1.5 2.5 3.5] and mean(X,2) is [1 4] Class support for input X: float: double, single See also median, std, min, max, cov. Overloaded functions or methods (ones with the same name in other directories) help fints/mean.m help sweepset/mean.m Reference page in Help browser doc mean >> mean(y) ans = 0.5220 >> help max MAX Largest component. For vectors, MAX(X) is the largest element in X. For matrices, MAX(X) is a row vector containing the maximum element from each column. For N-D arrays, MAX(X) operates along the first non-singleton dimension.
  • 21. [Y,I] = MAX(X) returns the indices of the maximum values in vector I. If the values along the first non-singleton dimension contain more than one maximal element, the index of the first one is returned. MAX(X,Y) returns an array the same size as X and Y with the largest elements taken from X or Y. Either one can be a scalar. [Y,I] = MAX(X,[],DIM) operates along the dimension DIM. When complex, the magnitude MAX(ABS(X)) is used, and the angle ANGLE(X) is ignored. NaN's are ignored when computing the maximum. Example: If X = [2 8 4 then max(X,[],1) is [7 8 9], 7 3 9] max(X,[],2) is [8 and max(X,5) is [5 8 5 9], 7 5 9]. See also min, median, mean, sort. Overloaded functions or methods (ones with the same name in other directories) help quantizer/max.m help fints/max.m help localpspline/max.m help localpoly/max.m Reference page in Help browser doc max >> [Y,y] = MAX(X) ??? Undefined function or variable 'X'. >> man(Y,y) ??? Undefined function or variable 'Y'. >> man(y) ??? Undefined command/function 'man'. >> max(y) ans = 0.9917 >> find(y==max(y))
  • 22. ans = 6 >> x=rand(5,1) x= 0.9501 0.2311 0.6068 0.4860 0.8913 >> sort(x) ans = 0.2311 0.4860 0.6068 0.8913 0.9501 >> help sort SORT Sort in ascending or descending order. For vectors, SORT(X) sorts the elements of X in ascending order. For matrices, SORT(X) sorts each column of X in ascending order. For N-D arrays, SORT(X) sorts the along the first non-singleton dimension of X. When X is a cell array of strings, SORT(X) sorts the strings in ASCII dictionary order. Y = SORT(X,DIM,MODE) has two optional parameters. DIM selects a dimension along which to sort. MODE selects the direction of the sort 'ascend' results in ascending order 'descend' results in descending order The result is in Y which has the same shape and type as X. [Y,I] = SORT(X,DIM,MODE) also returns an index matrix I. If X is a vector, then Y = X(I). If X is an m-by-n matrix and DIM=1, then for j = 1:n, Y(:,j) = X(I(:,j),j); end When X is complex, the elements are sorted by ABS(X). Complex matches are further sorted by ANGLE(X). When more than one element has the same value, the order of the
  • 23. elements are preserved in the sorted result and the indexes of equal elements will be ascending in any index matrix. Example: If X = [3 7 5 0 4 2] then sort(X,1) is [0 4 2 and sort(X,2) is [3 5 7 3 7 5] 0 2 4]; See also issorted, sortrows, min, max, mean, median. Overloaded functions or methods (ones with the same name in other directories) help cell/sort.m help sym/sort.m help xregdesign/sort.m help sweepset/sort.m Reference page in Help browser doc sort >> sort(x,ascend) ??? Undefined function or variable 'ascend'. >> sort(x,ascending) ??? Undefined function or variable 'ascending'. >> sort(x,'ascending') ??? Error using ==> sort sorting direction must be 'ascend' or 'descend'. >> sort(x,descend) ??? Undefined function or variable 'descend'. >> -sort(-x) ans = 0.9501 0.8913 0.6068 0.4860 0.2311 >> -x ans =
  • 24. -0.9501 -0.2311 -0.6068 -0.4860 -0.8913 >> a=-x a= -0.9501 -0.2311 -0.6068 -0.4860 -0.8913 >> sort(a) ans = -0.9501 -0.8913 -0.6068 -0.4860 -0.2311 >> -sort(-x) ans = 0.9501 0.8913 0.6068 0.4860 0.2311 >> sort(-x) ans = -0.9501 -0.8913 -0.6068 -0.4860 -0.2311 >> -sort(-a) ans =
  • 25. -0.2311 -0.4860 -0.6068 -0.8913 -0.9501 >>